<{include file='header.tpl'}>
<div class="setinfo"> 
<form action="?g=pc&a=setindex" method="post" target="hiddfrm">
	<ul class="settit">站点配置:</ul>
    <ul class="setput">
    	<li><span>站点名称：</span><input class="put" type="text" name="title" value="<{$view.title}>" /></li>
        <li><span>首页名称：</span><input class="put" type="text" name="indextit" value="<{if empty($view.indextit)}>首页<{else}><{$view.indextit}><{/if}>" /></li>
        <!--<li><span>列表页名称：</span><input class="put" type="text" name="listtit" value="<{if empty($view.listtit)}>行业资讯<{else}><{$view.listtit}><{/if}>" /></li>-->
    </ul>
    <ul class="settit">导航配置:<em><input type="button" class="button1" value="添加导航"onclick="addnav()" /></em></ul>
    <ul class="setput" id="navset" data-num="<{if !empty($navnum)}><{$navnum}><{else}>2<{/if}>">
    <{if !empty($navinfo)}>
    <{section name=l loop=$navinfo}>
    	<li><span>菜单名称：</span><input type="text" class="put" name="navname[<{$smarty.section.l.iteration}>]" value="<{$navinfo[l].name}>" /> 菜单链接：<input type="text" class="put nav<{$smarty.section.l.iteration}>" name="navurl[<{$smarty.section.l.iteration}>]" value="<{$navinfo[l].url}>" /><input type="hidden" name="navid[<{$smarty.section.l.iteration}>]" value="<{$navinfo[l].id}>" /><input type="button" class="button1" onclick="shownews('nav<{$smarty.section.l.iteration}>')" value="选择"><{if $smarty.section.l.iteration>1}><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /><{/if}></li>
    <{/section}>
    <{else}>
    	<li><span>菜单名称：</span><input type="text" class="put" name="navname[1]" /> 菜单链接：<input type="text" class="put nav1" name="navurl[1]"  onClick="shownews('nav1')" /><input type="hidden" name="vavid[1]" /><input type="button" class="button1" onclick="shownews('nav1')" value="选择" /></li>
    <{/if}>
    </ul>
    <ul class="settit">首页幻灯片:<em><input type="button" class="button1" value="添加幻灯片"onclick="addpic()" /></em></ul>
    <ul class="setput" id="picset" data-num="<{if !empty($flashnum)}><{$flashnum}><{else}>2<{/if}>">
    <{if !empty($flashinfo)}>
    	<{section name=l loop=$flashinfo}>
        	<li><span>幻灯片：</span><input type="text" class="put pic<{$smarty.section.l.iteration}>" name="pic[<{$smarty.section.l.iteration}>]" value="<{$flashinfo[l].url}>" /><input type="hidden" name="picid[<{$smarty.section.l.iteration}>]" value="<{$flashinfo[l].id}>" /><input type="button" class="button1" onClick="showflash('pic<{$smarty.section.l.iteration}>')" value="选择" /><{if $smarty.section.l.iteration>1}><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /><{/if}></li>
        <{/section}>
    <{else}>
    	<li><span>幻灯片：</span><input type="text" class="put pic1" name="pic[1]"  /><input type="hidden" name="picid[1]" /><input type="button" class="button1" onClick="showflash('pic1')" value="选择" /></li>
    <{/if}>
    </ul>
    <ul class="settit">推荐新闻:<em><input type="button" class="button1" value="添加新闻"onclick="addnews()" /></em></ul>
    <ul class="setput" id="newsset" data-num="<{if !empty($newsnum)}><{$newsnum}><{else}>2<{/if}>">
    <{if !empty($newsinfo)}>
    <{section name=l loop=$newsinfo}>
    <li><span>选择文章：</span><input type="text" class="put news<{$smarty.section.l.iteration}>" name="tpnews[<{$smarty.section.l.iteration}>]" value="<{$newsinfo[l].url}>"  /><input type="hidden" name="tpid[<{$smarty.section.l.iteration}>]" value="<{$newsinfo[l].id}>" /><input type="button" class="button1" value="选择"  onClick="shownews('news<{$smarty.section.l.iteration}>')" /><{if $smarty.section.l.iteration>1}><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /><{/if}></li>
    <{/section}>
    <{else}>
    	<li><span>选择文章：</span><input type="text" class="put news1" name="tpnews[1]"  /><input type="hidden" name="tpid[1]" /><input type="button" class="button1" value="选择"  onClick="shownews('news1')" /></li>
    <{/if}>
    </ul>
    <ul class="settit">友情链接:<em><input type="button" class="button1" value="添加友链"onclick="addad()" /></em></ul>
    <ul class="setput" id="adset" data-num="<{if !empty($adnum)}><{$adnum}><{else}>2<{/if}>">
    <{if !empty($adinfo)}>
    	<{section name=l loop=$adinfo}>
        	<li><span>名称：</span><input type="text" class="put" value="<{$adinfo[l].name}>" name="adname[<{$smarty.section.l.iteration}>]"  /> 网址：<input type="text" value="<{$adinfo[l].url}>" class="put" name="adurl[<{$smarty.section.l.iteration}>]"  /><{if $smarty.section.l.iteration>1}><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /><{/if}></li>
        <{/section}>
    <{else}>
    	<li><span>名称：</span><input type="text" class="put" name="adname[1]"  /> 网址：<input type="text" class="put" name="adurl[1]"  /></li>
    <{/if}>
    </ul>
    <ul class="setbutton"><input type="submit" class="button" value="保存" /></ul>
</form>
</div>
<script>
function addnav(){
	if($("#navset li").length>7){
		alert('导航菜单最多添加8个');
		return false;
	}
	var num = $("#navset").attr("data-num");
	var str='<li><span>菜单名称：</span><input type="text" class="put" name="navname['+num+']" /> 菜单链接：<input type="text" name="navurl['+num+']" class="put nav'+num+'" /><input type="hidden" name="navid['+num+']" /><input type="button" class="button1" onClick="shownews(\'nav'+num+'\')" value="选择" /><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /></li>';
	$("#navset").append(str);
	$("#navset").attr("data-num",(parseInt(num)+1));
}
function addpic(){
	if($("#picset li").length>9){
		alert('幻灯片最多添加10张');
		return false;
	}
	var num=$("#picset").attr("data-num");
	var str='<li><span>幻灯片：</span><input type="text" name="pic['+num+']" class="put pic'+num+'" /><input type="hidden" name="picid['+num+']" /><input type="button" class="button1" onClick="showflash(\'pic'+num+'\')" value="选择" /><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /></li>';
	$("#picset").append(str);
	$("#picset").attr("data-num",(parseInt(num)+1));
}
function addnews(){
	if($("#newsset li").length>3){
		alert('推荐新闻最多添加4篇');
		return false;
	}
	var num=$("#newsset").attr("data-num");
	var str='<li><span>选择文章：</span><input type="text" name="tpnews['+num+']" class="put news'+num+'" /><input type="hidden" name="tpid['+num+']" /><input type="button" class="button1" value="选择" onClick="shownews(\'news'+num+'\')" /><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /></li>';
	$("#newsset").append(str);
	$("#newsset").attr("data-num",(parseInt(num)+1));
}
function addad(){
	if($("#adset li").length>9){
		alert('友情链接最多添加10个');
		return false;
	}
	var num = $("#adset").attr("data-num");
	var str='<li><span>名称：</span><input type="text" class="put" name="adname['+num+']"  /> 网址：<input type="text" class="put" name="adurl['+num+']"  /><input type="button" class="cancel1" onclick="delpm(this)" value="删除" /></li>';
	$("#adset").append(str);
	$("#adset").attr("data-num",(parseInt(num)+1));
}
function delpm(obj){
	$(obj).parent().remove();
}
</script>
<{include file='foot.tpl'}>